package com.buybuyyi.stylistcrm.user.dao;

import stylistcrm.core.query.OrderObject;
import stylistcrm.core.query.PaginationConf;
import stylistcrm.core.services.order.exception.BizException;
import stylistcrm.core.services.user.requisition.QueryRequisitionConditionDto;
import stylistcrm.core.services.user.requisition.Requisition;
import stylistcrm.core.services.user.requisition.EnumRequisitionState;
import stylistcrm.core.services.user.requisition.RequisitionDto;

import java.util.HashMap;
import java.util.List;

/**
 * Created by yanwc on 2016/10/9.
 */
public interface RequisitionDao {

    /**
     * 翻页查询用户申请单
     * @param queryCondition
     * @return
     */
    List<RequisitionDto> queryByPage(QueryRequisitionConditionDto queryCondition) throws BizException;

    /**
     * 按条件查询总数据
     * @param queryCondition
     * @return
     * @throws BizException
     */
    Integer queryTotalCount( QueryRequisitionConditionDto queryCondition) throws BizException;


    /**
     * 新增用户申请单
     * @param requisitionDto
     * @return
     */
    boolean insert(RequisitionDto requisitionDto) throws BizException;

    /**
     * 更新申请状态
     * @param pkId 编号
     * @param state 状态
     * @return true更新成功，false更新失败
     */
    boolean updateRequisitionState(Long pkId,EnumRequisitionState state);

    /**
     * 查询用户申请的单
     * @param secUserId
     * @return
     */
    List<RequisitionDto> queryByUserId(Long secUserId);

    /**
     * 查询用户申请的单
     * @param secUserId
     * @return
     */
    List<RequisitionDto> queryByUserId(Long secUserId,EnumRequisitionState state);
    /**
     * 查询指定编号的申请
     * @param id
     * @return
     */
    RequisitionDto queryById(Long id);

}
